import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import './style.scss'
import App from './App.vue'
import { createPinia } from 'pinia'
import service from './hooks/service'
import request from './service/request'
import router from './router'
import global from './global'
import 'nprogress/nprogress.css'
import 'virtual:svg-icons-register'

const initApp = async () => {
  const app = createApp(App)
  app.use(global)
  app.use(createPinia())
  app.use(service)
  app.use(router)
  app.use(ElementPlus, {
    locale: zhCn
  })
  app.mount('#app')
  app.config.globalProperties.$http = request
}

initApp()